//
//  YMFriendManager.h
//  YMIM
//
//  Created by reyzhang on 2022/3/23.
//

#import <Foundation/Foundation.h>
#import "YMCommonDefs.h"
#import "YMFriendInfo.h"
#import "YMFriendApplyInfo.h"


NS_ASSUME_NONNULL_BEGIN
/**
 * IM 好友逻辑管理器
 */
@interface YMFriendManager : NSObject


/**
 * 获取好友列表
 */
- (void)getFriendsListWithCompletion:(void(^)(NSArray<YMFriendInfo *> * friendsList, YMErrorCode code))completionBlock;


/**
 * 搜索好友
 *
 * @param keyword 搜索关键字
 */
- (void)searchFriendsWithKeyword:(NSString *)keyword
                      completion:(void(^)(NSArray<YMFriendInfo *> *friendsList, YMErrorCode code))completionBlock;


/**
 * 获取好友申请列表
 *
 * @param page 页码
 *
 * @param pageSize 每页显示的数量
 */
- (void)getFriendsApplyListWithPage:(NSInteger)page
                           pageSize:(NSInteger)pageSize
                         completion:(void(^)(NSArray<YMFriendApplyInfo *> *applyList, YMErrorCode code))completionBlock;


/**
 * 申请添加好友
 *
 * @param targetUserId 对方用户Id
 *
 * @param applyMessage 申请内容
 */
- (void)applyAddFriendWithTargetId:(NSString *)targetUserId
                      applyMessage:(NSString *)applyMessage
                        completion:(void(^)(YMErrorCode code))completionBlock;



/**
 * 处理添加好友申请
 *
 * @param applyId 申请id
 *
 * @param isAgree 是否同意
 */
- (void)handleFriendApplyWithApplyId:(NSString *)applyId
                             isAgree:(BOOL)isAgree
                          completion:(void(^)(YMErrorCode code))completionBlock;



/**
 * 获取好友详情
 *
 * @param friendId 好友Id
 */
- (void)getFriendDetailWithFriendId:(NSString *)friendId
                         completion:(void(^)(YMFriendInfo *info,YMErrorCode code))completionBlock ;



/**
 * 添加好友备注
 *
 * @param friendId 好友Id
 *
 * @param note 备注
 */
- (void)addFriendNoteWithFriendId:(NSString *)friendId
                             note:(NSString *)note
                       completion:(void(^)(YMErrorCode code))completionBlock;




/**
 * 删除好友
 *
 * @param friendId 好友Id
 */
- (void)deleteFriendWithFriendId:(NSString *)friendId
                      completion:(void(^)(YMErrorCode code))completionBlock;



@end

NS_ASSUME_NONNULL_END
